package com.blb.proxy2;

public class ProxyDemo {
    public static void main(String[] args) {
//        CellphoneFactory cellphoneFactory = new CellphoneFactory();
//        CellphoneProxy cellphoneProxy = new CellphoneProxy(cellphoneFactory);
//        cellphoneProxy.sell("华为P60");

        CellphoneFactory cellphoneFactory = new CellphoneFactory();
        JDKFactoryProxy jdkFactoryProxy = new JDKFactoryProxy();
        CellphoneSales proxyInstance = (CellphoneSales) jdkFactoryProxy.createProxyInstance(cellphoneFactory);
        proxyInstance.sell("小米13");
        CellphoneSales proxyInstance2 = (CellphoneSales) jdkFactoryProxy.createProxyInstance(cellphoneFactory);
        proxyInstance.sell("华为");



    }
}
